const Sequelize = require('sequelize');

module.exports = function(sequelize, Sequelize) {
    return sequelize.define('barActivityInfo', {
        barID: {
            type: Sequelize.INTEGER(8),
            allowNull: false,
            comment: "酒吧id"
        },
        activityID: {
            type: Sequelize.INTEGER(8),
            allowNull: false,
            comment: "活动id"
        },
        state: {
            type: Sequelize.BOOLEAN(true),
            allowNull: false,
            comment: "活动状态,进行中(true),过期(false)"
        },
        imageAddress: {
            type: Sequelize.STRING(256),
            allowNull: false,
            comment: "活动图片地址"
        }
    }, {
        indexes: [
            {
                unique: true,
                fields: ['barID', 'activityID']
            }
        ]
    });

}